package com.sgxy.wmservice.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sgxy.wmservice.entity.WmStoreGoods;
import com.sgxy.wmservice.entity.vo.StoreGoodsVo;
import com.sgxy.wmservice.mapper.WmStoreGoodsMapper;
import com.sgxy.wmservice.service.WmStoreGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-04-29
 */
@Service
public class WmStoreGoodsServiceImpl extends ServiceImpl<WmStoreGoodsMapper, WmStoreGoods> implements WmStoreGoodsService {

    @Override
    public IPage<StoreGoodsVo> selectPageVoList(Page<StoreGoodsVo> sgPage, WmStoreGoods wmStoreGoods) {
        return baseMapper.selectPageVoList(sgPage,wmStoreGoods);
    }

    @Override
    public StoreGoodsVo getSGInfoById(String id) {
        return baseMapper.selectOneById(id);
    }
    //添加库存
    @Override
    public Boolean addStoreGoods(WmStoreGoods wmStoreGoods) {
        baseMapper.insert(wmStoreGoods);
        return true;
    }
    //更新库存数
    @Override
    public Boolean updateStockNum(WmStoreGoods wmStoreGoods) {
        baseMapper.updateById(wmStoreGoods);
        return true;
    }
}
